﻿CREATE TABLE [dbo].[CNVP_ProTypeRefDescripttion](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductTypeID] [int] NULL,
	[DescripttionName] [nvarchar](100) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CNVP_UserLevel](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[LevelName] [nvarchar](100) NULL,
	[DisCountPercent] [decimal](18, 2) NULL,
	[IsAcquiesce] [tinyint] NULL,
	[NeedPointsNum] [int] NOT NULL,
	[IsDelete] [tinyint] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CNVP_Products](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductName] [nvarchar](100) NOT NULL,
	[ProductClassID] [int] NULL,
	[ProductTypeID] [int] NULL,
	[BrandID] [int] NULL,
	[Intro] [nvarchar](2000) NULL,
	[Detaile] [text] NULL,
	[MarketPrice] [decimal](18, 2) NULL,
	[TradePrice] [decimal](18, 2) NULL,
	[ProductCode] [nvarchar](100) NULL,
	[UpTime] [datetime] NULL,
	[DownTime] [datetime] NULL,
	[EditTime] [datetime] NULL,
	[KeyWords] [nvarchar](100) NULL,
	[ProductUnit] [nvarchar](100) NULL,
	[ProductWeight] [decimal](18, 2) NULL,
	[CostPrice] [decimal](18, 2) NULL,
	[ProductNo] [nvarchar](100) NULL,
	[StockTotalNum] [int] NULL,
	[Allocation] [nvarchar](100) NULL,
	[ProductTags] [nvarchar](100) NULL,
	[IsDelete] [tinyint] NULL,
	[ProductState] [tinyint] NULL,
	[SeoInfoID] [int] NULL,
	[AddTime] [datetime] NULL,
	[StandardIDs] [nvarchar](100) NULL,
	[StandardValues] [nvarchar](100) NULL,
	[ImgProLoad] [nvarchar](255) NULL,
	[HotLink] [nvarchar](100) NULL,
	[AllowReview] [tinyint] NULL,
	[DeliveryFreightID] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProductsPic](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[SmallPic] [nvarchar](255) NULL,
	[BigPic] [nvarchar](255) NULL,
	[Pic] [nvarchar](255) NULL,
	[OriginalPic] [nvarchar](255) NULL,
	[ProductID] [int] NULL
) ON [PRIMARY]

GO
CREATE TABLE [dbo].[CNVP_AdminRole](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[RoleName] [nvarchar](100) NULL,
	[RolePower] [nvarchar](100) NULL,
	[IsLock] [tinyint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_PointsUDRcord](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[OperateTime] [datetime] NULL,
	[OperateDetail] [text] NULL,
	[PointsNum] [int] NOT NULL,
	[UserID] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProTypeRefExtendProperty](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductTypeID] [int] NULL,
	[ExtendPropertyName] [nvarchar](200) NULL,
	[StageShowType] [tinyint] NULL,
	[IsShow] [tinyint] NULL,
	[SelectItemValue] [nvarchar](200) NULL,
	[IsOrder] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProTypeRefStandard](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductTypeID] [int] NULL,
	[StandardID] [int] NULL,
	[ShowWay] [tinyint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Branks](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[BrankName] [nvarchar](100) NULL,
	[BrankAddress] [nvarchar](200) NULL,
	[BrankPic] [nvarchar](255) NULL,
	[OrderID] [int] NULL,
	[BrankOtherName] [nvarchar](100) NULL,
	[IsDetele] [tinyint] NULL,
	[BrankDetail] [text] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProTypeRefShopMustInfo](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductTypeID] [int] NULL,
	[MustInfoName] [nvarchar](100) NULL,
	[ShowWay] [tinyint] NULL,
	[MustInfoValue] [nvarchar](200) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CNVP_StandardValue](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[StandardID] [int] NULL,
	[StandardValueName] [nvarchar](100) NULL,
	[StandardValueOtherName] [nvarchar](100) NULL,
	[OrderID] [int] NULL,
	[StandardValuePic] [nvarchar](200) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_AdminRoleMenu](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[MenuID] [int] NOT NULL,
	[AdminRoleID] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Admin](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[AdminName] [nvarchar](100) NULL,
	[AdminPass] [nvarchar](100) NULL,
	[LastLoginIp] [nvarchar](100) NULL,
	[LastLoginTime] [datetime] NULL,
	[LoginNum] [int] NULL,
	[IsLock] [tinyint] NULL,
	[IsAdmin] [tinyint] NULL,
	[DepartmentName] [nvarchar](100) NULL,
	[AdminNo] [nvarchar](100) NULL,
	[AdminText] [text] NULL,
	[RoleID] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_GuestBook](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[GBAuthor] [nvarchar](100) NULL,
	[GBTitle] [nvarchar](100) NULL,
	[GBContent] [text] NULL,
	[AddTime] [datetime] NULL,
	[IsShow] [tinyint] NULL,
	[IsDelete] [tinyint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProPropertyDescripttion](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductID] [int] NOT NULL,
	[StandardValue] [nvarchar](100) NULL,
	[ProTypeRefDescripttionID] [int] NOT NULL,
	[ProductTypeID] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProductsDetail](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductID] [int] NULL,
	[ProDetailNo] [nvarchar](100) NULL,
	[StockNum] [int] NULL,
	[SalePrice] [decimal](18, 2) NULL,
	[CostPrice] [decimal](18, 2) NULL,
	[MarketPrice] [decimal](18, 2) NULL,
	[ProDetailWeight] [decimal](18, 2) NULL,
	[Allocation] [nvarchar](100) NULL,
	[IsShow] [tinyint] NULL,
	[StandardValueIDs] [nvarchar](100) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Favorite](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductID] [int] NULL,
	[UsersID] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Users](
	[ID] [int] IDENTITY(1,1) NOT NULL  PRIMARY KEY  CLUSTERED ,
	[UserName] [nvarchar](100) NULL,
	[UserPass] [nvarchar](100) NULL,
	[UserLevelID] [int] NOT NULL,
	[Email] [nvarchar](100) NULL,
	[PointsNum] [int] NOT NULL,
	[TotalAmount] [decimal](18, 2) NULL,
	[AddTime] [datetime] NULL,
	[AddIP] [nvarchar](100) NULL,
	[EndLoginIP] [nvarchar](100) NULL,
	[EndLoginTime] [datetime] NULL,
	[OtherText] [text] NULL,
	[IsDelete] [tinyint] NULL,
	[LoginNum] [int] NULL,
	[MobilePhone] [nvarchar](100) NULL,
	[Province] [nvarchar](100) NULL,
	[City] [nvarchar](100) NULL,
	[Area] [nvarchar](100) NULL,
	[GetAddress] [nvarchar](200) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Area](
	[ID] [int] NOT NULL PRIMARY KEY  CLUSTERED ,
	[Code] [nvarchar](50) NULL,
	[Name] [nvarchar](60) NULL,
	[CityID] [nvarchar](6) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_City](
	[ID] [int] NOT NULL PRIMARY KEY  CLUSTERED ,
	[Code] [nvarchar](6) NULL,
	[Name] [nvarchar](50) NULL,
	[ProvinceID] [nvarchar](6) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Province](
	[ID] [int] NOT NULL PRIMARY KEY  CLUSTERED ,
	[Code] [nvarchar](6) NULL,
	[Name] [nvarchar](40) NULL,
	[RangeName] [nvarchar](8) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Review](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[UserID] [nvarchar](100) NOT NULL,
	[ReviewTitle] [nvarchar](100) NULL,
	[ReviewContent] [text] NULL,
	[ProductID] [int] NOT NULL,
	[LastReplyAuthor] [nvarchar](100) NULL,
	[LastReplyTime] [datetime] NOT NULL DEFAULT (getdate()),
	[LastReplyContent] [Text] NULL,
	[IsShow] [tinyint] NULL,
	[IsTop] [tinyint] NULL,
	[IsDelete] [tinyint] NULL,
	[AddTime] [datetime] NOT NULL DEFAULT (getdate()),
	[rateStatus] [tinyint] NOT NULL DEFAULT (0)
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_OrderProShopMustInfo](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[OrderID] [int] NOT NULL DEFAULT (0),
	[ProductID] [int] NOT NULL DEFAULT (0),
	[ProDetailsID] [int] NOT NULL DEFAULT (0),
	[StandardValue] [nvarchar](100) NOT NULL,
	[ProTypeRefShopMustInfoID] [int] NOT NULL DEFAULT (0)
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Order](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[OrderNum] [nvarchar](100) NULL,
	[AddTime] [datetime] NULL,
	[ProductsTotalAmount] [decimal](18, 2) NULL,
	[OrderTotalAmount] [decimal](18, 2) NULL,
	[DeliveryWay] [nvarchar](100) NULL,
	[DeliveryPrice] [decimal](18, 2) NULL,
	[PayWay] [nvarchar](100) NULL,
	[IsSupportValue] [tinyint] NULL,
	[SupportValuePrice] [decimal](18, 2) NULL,
	[ProductWeight] [int] NULL,
	[PayFactorage] [decimal](18, 2) NULL,
	[BillRises] [nvarchar](100) NULL,
	[IsNeedBill] [tinyint] NULL,
	[BilTaxes] [decimal](18, 2) NULL,
	[PayCurrency] [nvarchar](100) NULL,
	[SalesPromotionAmount] [decimal](18, 2) NULL,
	[DiscountOrder] [decimal](18, 2) NULL,
	[MobilePhone] [nvarchar](100) NULL,
	[Phone] [nvarchar](100) NULL,
	[Email] [nvarchar](100) NULL,
	[PostTime] [datetime] NULL,
	[ZipCode] [nvarchar](100) NULL,
	[GetTrueName] [nvarchar](100) NULL,
	[Province] [nvarchar](100) NULL,
	[City] [nvarchar](100) NULL,
	[Area] [nvarchar](100) NULL,
	[GetAddress] [nvarchar](100) NULL,
	[BuyerID] [int] NULL,
	[IsDelete] [tinyint] NULL,
	[PayState] [tinyint] NULL,
	[DeliveryState] [tinyint] NULL,
	[Text] [text] NULL,
	[OrderState] [tinyint] NULL,
	[DeliveryNo] [nvarchar](100) NULL,
	[DeliveryCompany] [nvarchar](100) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_OrderProducts](
	[ID] [int] IDENTITY(1,1) NOT NULL  PRIMARY KEY  CLUSTERED ,
	[ProductName] [nvarchar](100) NULL,
	[ImgProLoad] [nvarchar](255) NULL,
	[ProductClassID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[ProductsDetailID] [int] NULL,
	[ProductNo] [nvarchar](100) NULL,
	[Price] [decimal](18, 2) NULL,
	[Num] [int] NULL,
	[TotalPrice] [decimal](18, 2) NOT NULL,
	[OrderID] [int] NOT NULL,
	[BuyerRate] [tinyint] NOT NULL DEFAULT (0),
	[ReviewID] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_SEOInfo](
	[ID] [int] IDENTITY(1,1) NOT NULL  PRIMARY KEY  CLUSTERED ,
	[OriginTitle] [nvarchar](200) NULL,
	[OriginKey] [nvarchar](300) NULL,
	[OriginDescription] [text] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Menu](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[Depth] [nvarchar](100) NULL,
	[MenuName] [nvarchar](100) NULL,
	[Weight] [int] NOT NULL,
	[MenuUrl] [nvarchar](100) NULL,
	[PreView] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_PostAddress](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[PostTitle] [nvarchar](100) NULL,
	[PostTrueName] [nvarchar](100) NULL,
	[Sex] [tinyint] NULL,
	[Province] [nvarchar](100) NULL,
	[City] [nvarchar](100) NULL,
	[Area] [nvarchar](100) NULL,
	[PostAddress] [nvarchar](200) NULL,
	[ZipCode] [nvarchar](100) NULL,
	[MobilePhone] [nvarchar](100) NULL,
	[Phone] [nvarchar](100) NULL,
	[Text] [text] NULL,
	[IsTolerant] [tinyint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Links](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[LinkName] [nvarchar](100) NULL,
	[LinkAddress] [nvarchar](255) NULL,
	[LinkPic] [nvarchar](255) NULL,
	[LinkType] [int] NULL,
	[OrderID] [int] NULL,
	[LinkClassID] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProTypeRefBranks](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductTypeID] [int] NULL,
	[BranksIDS] [nvarchar](500) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Template](
	[TemplateID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ColumnID] [int] NULL,
	[TemplateType] [tinyint] NULL,
	[ProjectName] [nvarchar](100) NULL,
	[TemplateUrl] [nvarchar](100) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_UnitsInfo](
	[UnitID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[StyleID] [int] NULL,
	[ProjectName] [nvarchar](100) NULL,
	[UnitName] [nvarchar](100) NULL,
	[UnitHTML] [text] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_GetAddress](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[TrueName] [nvarchar](100) NULL,
	[MobilePhone] [nvarchar](100) NULL,
	[Phone] [nvarchar](100) NULL,
	[Province] [nvarchar](100) NULL,
	[City] [nvarchar](100) NULL,
	[Area] [nvarchar](100) NULL,
	[GetAddress] [nvarchar](200) NULL,
	[UsersID] [int] NULL,
	[ZipCode] [nvarchar](100) NULL,
	[IsTolerant] [tinyint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Column](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ColumnName] [nvarchar](100) NULL,
	[ColumnType] [tinyint] NULL,
	[IsShow] [tinyint] NULL,
	[OrderID] [int] NOT NULL,
	[ColumnUrl] [nvarchar](100) NULL,
	[TemplateUrl] [nvarchar](100) NULL,
	[AddressRoute] [nvarchar](100) NULL,
	[Depth] [nvarchar](100) NULL,
	[ChildColumnNum] [int] NULL,
	[IsSystemColumn] [tinyint] NULL,
	[SeoInfoID] [int] NULL,
	[ProductTypeID] [int] NULL,
	[AlipayInInterfaceType] [tinyint] NULL,
	[PayImg] [nvarchar](255) NULL,
	[PayAccountNumber] [nvarchar](100) NULL,
	[PayParterID] [nvarchar](100) NULL,
	[PayKey] [nvarchar](100) NULL,
	[Text] [text] NULL,
	[AllowReview] [tinyint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProductType](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProTypeName] [nvarchar](100) NULL,
	[IsEntityType] [tinyint] NULL,
	[IsRefBranks] [tinyint] NULL,
	[IsRefExtendProperty] [tinyint] NULL,
	[IsRefDescripttion] [tinyint] NULL,
	[IsRefShopMustInfo] [tinyint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Standard](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[StandardName] [nvarchar](100) NULL,
	[ShowWay] [tinyint] NULL,
	[StandardOtherName] [nvarchar](100) NULL,
	[StandardType] [tinyint] NULL,
	[StandardDetail] [text] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_ProExtendeProperty](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[ProductID] [int] NULL,
	[StandardVaule] [nvarchar](100) NULL,
	[ProTypeRefExtendPropertyID] [int] NULL,
	[ProductTypeID] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_NewsInfo](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[NewsClassID] [int] NULL,
	[NewsTitle] [nvarchar](100) NULL,
	[NewsContent] [text] NULL,
	[AddTime] [datetime] NULL,
	[UpdateTime] [datetime] NULL,
	[IsShow] [tinyint] NULL,
	[ShowTime] [datetime] NULL,
	[IsDelete] [tinyint] NULL,
	[HotLink] [nvarchar](100) NULL,
	[SeoInfoID] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_Ads](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[IsType] [tinyint] NULL,
	[AdClassID] [int] NULL,
	[AdName] [nvarchar](100) NULL,
	[AdPic] [nvarchar](255) NULL,
	[AdAddress] [nvarchar](255) NULL,
	[AdText] [nvarchar](1000) NULL,
	[AdWidth] [int] NULL,
	[AdHight] [int] NULL,
	[IsShow] [tinyint] NULL,
	[OrderID] [int] NULL,
	[AddTime] [datetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CNVP_DeliveryTemplate](
	[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY  CLUSTERED ,
	[DeliveryTemplateClassID] [int] NULL,
	[RectangleName] [nvarchar](50) NULL,
	[ItemName] [nvarchar](50) NULL,
	[MarginTop] [decimal](18, 2) NULL,
	[MarginLeft] [decimal](18, 2) NULL,
	[RectangleWidth] [decimal](18, 2) NULL,
	[RectangleHight] [decimal](18, 2) NULL
) ON [PRIMARY]
GO

CREATE TABLE [CNVP_RetrievePwdInfo](
	[ID] [uniqueidentifier] PRIMARY KEY NOT NULL,
	[PostTime] [datetime] NULL,
	[UserName] [nvarchar](50) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CNVP_DeliveryFreight]
(
	[ID] [int] IDENTITY (1,1) NOT NULL PRIMARY KEY  CLUSTERED,
	[DeliveryFreightColumnID] [int] NOT NULL,
	[DeliveryType] [tinyint] NOT NULL,
	[ProvinceArrayName] [nvarchar] (200) NULL,
	[ProvinceArray] [nvarchar] (200) NULL,
	[FirstPiece] [int] NOT NULL,
	[FirstFreight] [decimal] (18,2) NOT NULL,
	[AddPiece] [int] NOT NULL,
	[AddFreight] [decimal] (18,2) NOT NULL,
	[IsDefault] [tinyint] NOT NULL DEFAULT ((0))
) ON [PRIMARY]
GO
